package com.recsmile.sgs.client.commonds.sync;

import com.recsmile.sgs.client.commonds.GeneralGameUIClientCommand;
import com.recsmile.sgs.client.entity.Hero;
import com.recsmile.sgs.client.entity.InvalidPlayerCommandException;
import com.recsmile.sgs.client.ui.components.GamePanel;

public class SyncAttackUsedSetGameUIClientCommand extends GeneralGameUIClientCommand {
	
	private static final long serialVersionUID = 7479944347797215425L;
	
	private final int amount;
	
	public SyncAttackUsedSetGameUIClientCommand(int amount) {
		this.amount = amount;
	}

	@Override
	protected void execute(GamePanel<? extends Hero> panel) {
		try {
			panel.getContent().getSelf().setAttackUsed(amount);
		} catch (InvalidPlayerCommandException e) {
			e.printStackTrace();
		}
	}

}
